<template>
	<div>
		<themeHeader></themeHeader>
		<!-- <content3></content3> -->
		<div class="search-con cards" >
		<router-link to="/searchlink">
		<div class="card demo-card-header-pic" v-for="item in cardsList" v-on:click="conFn(item.id)">
			<a>
			    <div valign="bottom" class="card-header color-white no-border no-padding">
			       	<img class='card-cover' v-bind:src="item.imgsrc" alt="">
			    </div>
			    <div class="card-content">
				    <div class="card-content-inner">
				    <h3>{{item.title}}</h3>
				        <p class="color-gray">{{item.content}}</p>
				    </div>
			    </div>
			    <div class="card-footer">
				    <div class="link">
				      	<img class="card-footer-img" v-bind:src="item.tximg">
				      	<span class="color-gray card-footer-left">{{item.username}}</span>
				    </div>
				    <div class="link">
				      	<p class="color-gray">{{item.time}}</p>
				    </div>
			    </div>
			</a>
		</div>
		</router-link>
	</div>
	</div>
</template>
<script type="text/javascript">
	// import Content3 from "./component/content3.vue";
	import ThemeHeader from "./../home/component/themeHeader.vue";
	import Content3 from "./component/content3.vue";
	export default{
		data(){
			return{
				cardsList:{}
			}
		},
		components:{
			Content3,
			ThemeHeader
		},
		methods:{
			conFn:function(link){
				localStorage.setItem("conLink",link);
			}
		},
		mounted(){
			var txt=localStorage.getItem("bannerTxt");
			console.log(txt);
			var _this=this;
			var txt=localStorage.getItem("bannerTxt");
			$.ajax({
				type:"get",
				url:"http://localhost:8088/shop2/searchp.php",
				data:{type:"banner",banner:txt},
				dataType:"json",
				success:function(data){
					console.log(data);
					_this.cardsList=data.data;
				}
			});
		}
	}
</script>